//
//  STRefreshTableView.m
//  赛拓
//
//  Created by 王磊 on 8/6/16.
//  Copyright © 2016 立金所. All rights reserved.
//

#import "STRefreshTableView.h"
@interface STRefreshTableView()


@end
@implementation STRefreshTableView

- (void)commitInit {
    [super commitInit];
    
    MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(loadNewData)];
    
    header.automaticallyChangeAlpha = YES;
    
    [header setValue:@(1) forKeyPath:@"lastUpdatedTimeLabel.hidden"];
    [header setTitle:@"下拉刷新" forState:MJRefreshStateIdle];
    [header setTitle:@"松开载入" forState:MJRefreshStatePulling];
    [header setTitle:@"正在载入..." forState:MJRefreshStateRefreshing];
    [header setTitle:@"正在载入..." forState:MJRefreshStateWillRefresh];
    [header setTitle:@"暂无更多数据" forState:MJRefreshStateNoMoreData];
    
    [header setValue:ST_BLACK_COLOR forKeyPath:@"stateLabel.textColor"];
    header.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
    self.mj_header = header;
    
    [self.mj_header beginRefreshing];
    
    self.bounces = true;
    
}
- (void)loadNewData {
    
    [self.mDelegate loadNewData];
}


@end
